﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HA.ModFlow.Domain.DomainLayer
{
    /// <summary>
    /// 判断网格是否发生了变化
    /// </summary>
   public  class IsGridDataChanged
    {
       /// <summary>
       /// 判断网格的高程值是否发生了变化
       /// </summary>
       /// <param name="origionElevation">旧的高程值信息</param>
       /// <param name="newElevation">新的高程值信息</param>
       /// <returns>改变返回true  未改变返回false</returns>
       public static bool IsGridDataElevationChanged(List<double[,]> origionElevation,List<double[,]> newElevation)
       {

           if (origionElevation .Count !=newElevation .Count )
           {
               return true;
           }

           for (int z = 0; z < origionElevation .Count ; z++)
           {
               for (int rows = 0; rows < origionElevation[z].GetLength (0); rows++)
               {
                   for (int cols = 0; cols < origionElevation[z].GetLength (1); cols++)
                   {

                       if (origionElevation[z][rows,cols ]!=newElevation [z][rows ,cols ])
                       {
                           return true;

                       }

                   }
               }             
           }

           return false;
       }


    }
}
